package com.ms.game.bank;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import com.ms.game.bank.message.BankRequest;
import com.ms.game.bank.message.CBankBookDetailsRequest;
import com.ms.game.lobby.GameLobbyModule;
import com.xpec.c4.message.MessageTypes;
import com.xpec.c4.service.annotations.MessageType;
import com.xpec.c4.service.common.BaseMessageAction;
import com.xpec.c4.service.contexts.Contexts;

public class BankAction extends BaseMessageAction {

	@SuppressWarnings("unused")
	private static final Log log = LogFactory.getLog(BankAction.class);
	
	@MessageType(typeCode = MessageTypes.C_BANK_INFO_REQUEST)
	public void openBankPage(Boolean request) {
		GameLobbyModule module = (GameLobbyModule) Contexts.getModule();
		BankProcessor.OnOpenBankPage(sessionID, module, request);
	}
	
	@MessageType(typeCode = MessageTypes.C_BANK_DEPOSIT_REQUEST)
	public void depositBank(BankRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		BankProcessor.OnDeposit(sessionID, request, module);
	}
	
	@MessageType(typeCode = MessageTypes.C_BANK_GET_CASH_REQUEST)
	public void getCashBank(BankRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		BankProcessor.OnGetCash(sessionID, request, module);
	}
	
	@MessageType(typeCode = MessageTypes.C_BANK_CHANGE_PASSWORD_INLOBBY_REQUEST)
	public void changePassword(BankRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		BankProcessor.OnChangePasswordInLobby(sessionID, request, module);
	}
	
	@MessageType(typeCode = MessageTypes.C_BANK_CREATE_PASSWORD_INLOBBY_REQUEST)
	public void createPassword(BankRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		BankProcessor.OnCreatePasswordInLobby(sessionID, request, module);
	}
	
	@MessageType(typeCode = MessageTypes.C_BANK_GET_BANKBOOK_DETAILS_REQUEST)
	public void getBankBookRecord(CBankBookDetailsRequest request){
		GameLobbyModule module = (GameLobbyModule)Contexts.getModule();
		BankProcessor.OnGetBankBookDetails(sessionID, module, request);
	}
	
	@MessageType(typeCode = MessageTypes.C_BANK_ADD_CASH_ACCOUNT_TO_PLAYER_REQUEST)
	public void addCashPointAccountToPlayer(BankRequest request){
		//不存在的功能
	}
	
}
